//

import {
  logger
} from '../../helpers/logger'

export default {
  actions: {
    updateProfileRequest({
      commit
    }, formData) {
      return axios.post('/api/profile/edit', formData).then(res => {
        logger(res.data)
        commit('showNotification', {
          level: 'success',
          msg: '资料修改成功'
        })
      }).catch(err => {
        logger(err.response)
        commit('showNotification', {
          level: 'danger',
          msg: '资料修改失败'
        })
      })
    }
  }
}
